﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>02m-Resize: Container Test</title>
	<style type="text/css">
		body, html {
			width: 100%;
			height: 100%;
			margin: 0;
			background-color: lightgreen;
			overflow: hidden;
		}
	</style>
	<script src="../bootloader.js" type="text/javascript"></script>
	<script type="text/javascript">
		var c;
		c = new opus.Container({
			name: "top",
			parentNode: document.body,
			styles: {position: "absolute", border: 8, padding: 4, borderColor: "green"},
			controls: [
				{l:0, t:0, r:120, b:60, layoutKind: "absolute", controls: [
					{name: "json", w:"100%", h:"100%", styles: {bgColor:"#F1F1F1", overflow: "scroll", margin: 4, border: 4}},
					{r:124, b:30, w:83, h:28, styles: {border: 2}, content: "<button>Okesque</button>"},
					{r:30, b:30, w:87, h:28, styles: {border: 2}, content: "<button>Cancelish</button>"}
				]},
				{w:120, t:0, r:0, b:60, styles: {bgColor:"#F1F1F1", overflow: "auto", padding: 4, margin: 4, border: 4}, content: "Column"},
				{l:0, h:60, r:0, b:0, styles: {bgColor:"#F1F1F1", overflow: "auto", padding: 4, margin: 4, border: 4}, content: "Footer"},
				{w:8, h:8, styles: {bgColor:"red"}},
				{r:0, w:8, h:8, styles: {bgColor:"red"}},
				{b:0, w:8, h:8, styles: {bgColor:"red"}},
				{r:0, b:0, w:8, h:8, styles: {bgColor:"red"}}
			]
		});
		go = function() {
			// Normally bounds are managed by a Layout object, there is no way to specify bounds in the control constructor.
			resize();
			// Serialize c's properties as content for control "json"
			c.$.json.setContent("<pre>" + c.serialize() + "</pre>");
			// Render everything
			c.render();
		}
		resize = function() {
			c.setBounds({w: Math.max(document.body.offsetWidth, 376), h: Math.max(document.body.offsetHeight, 164)});
		}
	</script>
</head>
<body onload="go()" onresize="resize()">
</body>
</html>
